home *** CD-ROM | disk | FTP | other *** search
/ Loadstar 145 / 145.d81 / t.disc d < prev    next >
Text File  |  2022-08-26  |  6KB  |  197 lines

  1.  
  2.  
  3.  
  4.  
  5.  A complete dissection of Gfx-Zone
  6.  
  7.            by XmikeX
  8.  
  9.  
  10.     Note from Jeff: the GFX zone Run
  11. It file contains some of my absolute
  12. favorite SID music.  I just like it.
  13. I give fair warning though that one
  14. of the images may be offensive to
  15. more sensitive viewers.
  16.  
  17.     The Graphics-Zone demo was
  18. released August 31, 1995.  It was
  19. received with open arms and despite
  20. its simplicity, its unabashed
  21. unorthodoxy allowed it to reach the
  22. third highest spot in the Dec95. NTSC
  23. demo ballots. Gfx-Zone and the other
  24. two files included in the gfx-
  25. zone.sfx package were the
  26. culmination
  27. of ten days of self-taught assembly
  28. programming.  I could not have done
  29. it however without the guidance
  30. obtained from the following sources;
  31.  
  32.   - Coder's World 1,2, and 3 by
  33. 'Wrongway and The Phantom', FOE Press
  34. :)
  35.  
  36.   - 128 Machine Language for
  37. Beginners by Richard Mansfield
  38.  
  39.   - Mapping the Commodore 128 by
  40. Ottis R. Cowper
  41.  
  42.   - Inspiration from 'The Last
  43. Digital Excess Demo', 'Skeletor
  44. Movie', 'Digital Acid', C=Hacking -
  45. Issue #7, the people on the IRC
  46. channel #c-64, 'SYS4096' music by
  47. AMJ, and Thinktank who tragically
  48. passed away months prior to the demo
  49. but had released his amazing
  50. Commodore/Graphics low-res (40 by 25)
  51. artwork to the public a few years
  52. before.
  53.  
  54.     Graphics-Zone is not an overtly
  55. arrogant and complicated
  56. demonstration.  It consists of 21
  57. Commodore/Graphics (i.e., low
  58. resolution PETSCII) full-screen
  59. drawings (that happen to be *well-
  60. drawn*) placed in synch with a very
  61. nice SID tune running in the
  62. background.  There is little if any
  63. 'Top Code' in the demo and since I
  64. wrote it as a beginner, there should
  65. not be anything exceedingly fancy in
  66. the code itself that would preclude
  67. its use as a training vehicle for
  68. those not fully skilled in 6502 ML.
  69. In fact, there are some half-baked
  70. methods in the code that are rather
  71. simplistic even for a beginner. With
  72. this in mind, I hope to share some of
  73. the triumphs and pitfalls so as to
  74. instill a motivative spirit in those
  75. who seek to learn, and perhaps render
  76. a smile in those who already know
  77. :).
  78.  
  79.     As a great deal of you have
  80. already seen, running Graphics-Zone
  81. is a matter of loading it and typing
  82. "run".  The first two screens pop up
  83. to form the intro sequence where two
  84. C/G pictures are flipped back and
  85. forth slowly to match the tempo of
  86. the music.  When the music speeds up,
  87. the intro pics are abandoned for the
  88. most part and the rest of the C/G
  89. pics in memory fly at you in a mad
  90. attempt to keep up with the tempo.
  91. After a minute or two of this, the
  92. music and pics loop back to their
  93. start sequences and begin anew.
  94. There is nothing mind shaking about
  95. it.  The whole demo is basically a
  96. planned sequence of memory moves for
  97. the pics with an interrupt (IRQ)
  98. driven music player behind it.
  99.  
  100.     The main block of C/G pics are
  101. located from $3000 to $bfff with
  102. three additional pics at $0800-$0fff,
  103. $2800-$2fff, and $c800-$cff0.  Each
  104. C/G pic occupies 2 kilobytes (KB),
  105. the first KB is the screen data while
  106. the last KB represents color memory,
  107. as follows:
  108.  
  109.  ; Memory Structure - C/G pictures
  110.  ;
  111.  ; -------------------------------
  112.  $3000  - 0 kilobyte, start of pic 1
  113.  ; ! char data  for C/G pic 1
  114.  ; ------------------------------
  115.  -$3400  - 1 kilobyte, picture 1
  116.  ; ! color data for C/G pic 1
  117.  ; -------------------------------
  118.  $37ff  - 2 kilobytes, picture 1
  119. ends
  120.  ;
  121.  ;
  122.  ; ------------------------------
  123.  $3800  - 0 kilobyte, start of
  124.  picture 2
  125.  ; ! char data  for C/G pic 2
  126.  ; ------------------------------
  127.  $3c00  - 1 kilobyte, picture 2
  128.  ; ! color data for C/G pic 2
  129.  ; ------------------------------
  130.  $3fff  - 2 kilobytes, picture 2
  131. ends
  132.  
  133.   In actuality, the screen and color
  134. data do not extend right up to the
  135. next page boundary (i.e., at the
  136. $xxff - $xx00 junctions in hex), they
  137. in fact end at $xxe7 (e.g., $33e7,
  138. $37e7, $3be7, $3fe7, etc).  For
  139. simplicity's sake, I did not worry
  140. about the extra bytes at the end, and
  141. I started the each block of pic data
  142. (screen/char or color data) at a page
  143. boundary $xx00. But C/G pics are
  144. simply petscii text and color, right?
  145. Yes, they do not come organized as
  146. shown above and for a short time, the
  147. prospect of extracting them into a
  148. more usable form seemed daunting.
  149. After a few minutes, the solution
  150. came to me.  I read them off the disk
  151. and printed them to the forty column
  152. screen on my 128.  When this was
  153. done, I peeked an image of VIC screen
  154. memory ($0400-$07e7) and VIC color
  155. memory ($d800-$dbe7) and poked the
  156. image to $3000-$33e7 (screen mem) and
  157. $3400-$37e7 (color mem).  Then I
  158. binary-saved them to disk using the
  159. monitor (via the 80 column display of
  160. course).  I repeated this step
  161. twenty-one times because I was
  162. fortunate enough to have twenty-one
  163. quality C/G pics at my disposal :).
  164. In retrospect, I later found out that
  165. certain "taboo" areas of memory such
  166. as the area under the kernel
  167. could have been used to store even
  168. more data, but at the time I was
  169. quite happy to have been able just to
  170. switch out Basic and use the space it
  171. took up.
  172.  
  173.   What about the rest of the demo,
  174. the music and code, eh?  Not a
  175. problem there. The music player/data
  176. starts at $1000 and heads up to
  177. around $26b0 while the main code for
  178. the demo itself starts at $c000.  I
  179. took all the converted pic files (the
  180. ones I had binary-saved) and used a
  181. packer to relocate them to their
  182. final destinations in memory, along
  183. with the music and code.  Also,
  184. because packers conveniently compress
  185. all data and code into a run-time
  186. executable, I didn't have to worry
  187. about providing a front-end ability
  188. to be able to "RUN" the ML from
  189. basic.  The packer took care of all
  190. this for me, all I had to do was
  191. specify a start address for the
  192. machine-language (ML) code.
  193.  
  194.       Continued in part 2
  195.  
  196.  
  197.